cd "/Users/jackpaine/Dropbox/Current papers/Rebellions and State Strength/Analyses/final"


**********************
***Install packages***
**********************
*ssc install splitvallabels


****************************************************************************
***Figure 1. Comparing Regime Durability: Rebel vs. Non-Rebel Autocracies***
****************************************************************************
use cmp_allauth.dta, clear
drop duration_years
gen duration_years = end_regime_year - start_regime_year
gen type="<5 years" if duration_years<5
replace type="20+ years" if duration_years>=20
replace type="5-19 years" if type==""
drop if start_regime_year>2000 & end_regime_year==2020
graph bar if rebel_cmp==1, over(type, descending) title("Rebel Autocracies") ///
bar(1, color(gray)) ytitle("Percent") name(panela, replace) nodraw ylabel(0(10)50)
graph bar if rebel_cmp==0, over(type, descending) title("Non-Rebel Autocracies") ///
bar(1, color(gray)) ytitle("Percent") name(panelb, replace) nodraw ylabel(0(10)50)
graph combine panela panelb, xsize(3) ysize(1) graphregion(color(white)) iscale(1.5)
graph export figure_1.pdf, replace

*GWF rebel regimes compared to CMP rebel regimes
use cmp_core.dta, clear
summarize regime_fail if gwf_rebel==1
summarize regime_fail if gwf_rebel==0
summarize regime_fail if gwf_rebel==. & democracy==0


*******************************************
***Figure 3. Comparing Regime Durability***
*******************************************
use cmp_core.dta, clear
keep if democracy == 0
*Time period
use cmp_core.dta, clear
keep if democracy == 0
collapse (mean) average = regime_fail, by(unified)
gen period = 1
tempfile full
save `full'
use cmp_core.dta, clear
keep if democracy == 0
gen byte period = .
replace period = 2 if start_regime_year < 1946
replace period = 3 if start_regime_year >= 1946 & year < 1989
replace period = 4 if start_regime_year >= 1989
collapse (mean) average = regime_fail, by(unified period)
append using `full'
replace average = round(100 * average, 0.1)
label define period_name 1 "Full sample" 2 "Pre-Cold War" 3 "Cold War" 4 "Post-Cold War"
label values period period_name
label define unified_name 0 "Fractured" 1 "Unified"
label values unified unified_name
splitvallabels period
graph hbar (mean) average, ///
    over(unified,label(labsize(small))) ///
    over(period, label(labsize(small)) relabel(`r(relabel)')) ///
    ytitle("Percentage of years with regime failure", size(small)) ///
    blabel(bar, format(%4.1f)) intensity(0) title("Time period") ylabel(0(5)25) ///
    asyvars bar(1, lcolor(black) fcolor(black) fintensity(inten100)) ///
    bar(2, lcolor(black) fcolor(white) fintensity(inten100)) ///
    legend(off) name(panela, replace) nodraw
*Region
use cmp_core.dta, clear
keep if democracy == 0
collapse (mean) average = regime_fail, by(unified region)
replace average = round(100 * average, 0.1)
label define region_name 1 "L. America" 2 "Europe" 3 "SSA" 4 "MENA" 5 "Asia/Pac."
label values region region_name
label define unified_name 0 "Fractured" 1 "Unified"
label values unified unified_name
splitvallabels region
graph hbar (mean) average, ///
    over(unified,label(labsize(small))) ///
    over(region, label(labsize(small)) relabel(`r(relabel)')) ///
    ytitle("Percentage of years with regime failure", size(small)) ///
    blabel(bar, format(%4.1f)) intensity(0) title("Region") ylabel(0(5)25) ///
    asyvars bar(1, lcolor(black) fcolor(black) fintensity(inten100)) ///
    bar(2, lcolor(black) fcolor(white) fintensity(inten100)) ///
    legend(off) name(panelb, replace) nodraw
*War aims
use cmp_core.dta, clear
keep if democracy == 0
gen warcat = .
replace warcat = 1 if sec_war + indep_war == 0
replace warcat = 2 if sec_war == 1
replace warcat = 3 if indep_war == 1
collapse (mean) average = regime_fail, by(unified warcat)
replace average = round(100 * average, 0.1)
label define warcat_name 1 "Center" 2 "Separatist" 3 "Decol."
label values warcat warcat_name
label define unified_name 0 "Fractured" 1 "Unified"
label values unified unified_name
splitvallabels warcat
graph hbar (mean) average, ///
    over(unified,label(labsize(small))) ///
    over(warcat, label(labsize(small)) relabel(`r(relabel)')) ///
    ytitle("Percentage of years with regime failure", size(small)) ///
    blabel(bar, format(%4.1f)) intensity(0) title("War experience") ylabel(0(5)25) ///
    asyvars bar(1, lcolor(black) fcolor(black) fintensity(inten100)) ///
    bar(2, lcolor(black) fcolor(white) fintensity(inten100)) ///
    legend(off) name(panelc, replace) nodraw
*Produce the figure
graph combine panela panelb panelc, ///
    cols(3) ///
    xsize(3.5) ysize(1) ///
    graphregion(color(white)) iscale(1.5)
graph export figure_3.pdf, replace


*****************************************************
***Table 2. Determinants of Rebel Regime Breakdown***
*****************************************************
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_2.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_2.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_2.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_2.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_2.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_2.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


*****************************************************
***Table 3. Differences in Means on Key Covariates***
*****************************************************
use cmp_core.dta, clear
drop if year!=start_regime_year
ttest lw if democracy==0, by(unified)
ttest leftist if democracy==0, by(unified)
ttest foreign_support if democracy==0, by(unified)
ttest frac_ethnic if democracy==0, by(unified)
ttest lmtnest if democracy==0, by(unified)
ttest civilreg if democracy==0, by(unified)


******************************************
***Figure 4. Power-Sharing Trajectories***
******************************************
use cmp_mechanisms.dta, clear
tab sharing if unified==0 & democracy==0
tab sharing if unified==1 & democracy==0


***********************************
***Table 4. Recurrent Rebellions***
***********************************
use cmp_mechanisms.dta, clear
summarize any_reb any_frreb any_crreb any_otherreb if democracy==0
summarize any_reb any_frreb any_crreb any_otherreb if unified==1 & democracy==0
summarize any_reb any_frreb any_crreb any_otherreb if unified==0 & democracy==0
summarize success_reb success_frreb success_crreb success_otherreb if democracy==0
summarize success_reb success_frreb success_crreb success_otherreb if unified==1 & democracy==0
summarize success_reb success_frreb success_crreb success_otherreb if unified==0 & democracy==0


***APPENDIX


******************************************************************
***Figure A.1. Disaggregate Medium-Length Regimes from Figure 1***
******************************************************************
use cmp_allauth.dta, clear
drop duration_years
gen duration_years = end_regime_year - start_regime_year
gen type=0 if duration_years<5
replace type=1 if duration_years>=5 & duration_years<10
replace type=2 if duration_years>=10 & duration_years<15
replace type=3 if duration_years>=15 & duration_years<20
replace type=4 if duration_years>=20
label define typelabel 0 "<5 years" 1 "5-9" 2 "10-14" 3 "15-19" 4 "20+"
label values type typelabel
drop if start_regime_year>2000 & end_regime_year==2020
graph bar if rebel_cmp==1, over(type) title("Rebel Autocracies") blabel(total, format(%9.0f)) ///
bar(1, color(gray)) ytitle("Percent") name(panela, replace) nodraw ylabel(0(10)50)
graph bar if rebel_cmp==0, over(type) title("Non-Rebel Autocracies") blabel(total, format(%9.0f)) ///
bar(1, color(gray)) ytitle("Percent") name(panelb, replace) nodraw ylabel(0(10)50)
graph combine panela panelb, xsize(3) ysize(1) graphregion(color(white)) iscale(1.5)
graph export figure_a1.pdf, replace


***************************************************
***Table A.3. Summary Statistics for Core Sample***
***************************************************
use cmp_core.dta, clear
gen region1=0
replace region1=1 if region==1
gen region2=0
replace region2=1 if region==2
gen region3=0
replace region3=1 if region==3
gen region4=0
replace region4=1 if region==4
gen region5=0
replace region5=1 if region==5
gen period0=0
replace period0=1 if period_coldwar==0
gen period1=0
replace period1=1 if period_coldwar==1
gen period2=0
replace period2=1 if period_coldwar==2
label var region1 "Region: Latin America"
label var region2 "Region: Europe"
label var region3 "Region: SSA"
label var region4 "Region: MENA"
label var region5 "Region: Asia/Pacific"
label var period0 "Period: Pre-Cold War"
label var period1 "Period: Cold War"
label var period2 "Period: Post-Cold War"
keep if democracy==0
keep regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest region* period*
outreg2 using table_a3.tex, sum(log) replace label tex(frag)


*************************************************************
***Table A.4: Rebellions that Switched Structure Over Time***
*************************************************************
use cmp_core.dta, clear
drop if year!=start_regime_year
keep if change_timing!=.
gen year_switch = end_war-change_timing
sort unified_dynamic change_timing ccode casename
list casename warname end_war year_switch change_timing


******************************************************************************
***Table A.5. Alternative Rules to Distinguish Unified/Fractured Rebellions***
******************************************************************************
*Panel A. Lower troop threshold for unified
use cmp_core.dta, clear
reg regime_fail unified_75 peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified_75) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_75 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified_75 indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_75 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified_75 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_75 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a5_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_75 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_75 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a5_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_75 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_75 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a5_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_75 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Count alliances as unified
use cmp_core.dta, clear
reg regime_fail unified_alliance peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified_alliance) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_alliance lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified_alliance indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_alliance ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified_alliance ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_alliance lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a5_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_alliance indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_alliance lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a5_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_alliance indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_alliance lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a5_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_alliance indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel C. Count mergers as fractured
use cmp_core.dta, clear
reg regime_fail unified_merger peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panelc.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified_merger) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_merger lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified_merger indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_merger ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified_merger ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_merger lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a5_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_merger indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_merger lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a5_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_merger indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_merger lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a5_panelc.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_merger indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel D. Switch scoring for late-change rebellions
use cmp_core.dta, clear
reg regime_fail unified_nolatechange peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_paneld.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified_nolatechange) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_nolatechange lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified_nolatechange indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_nolatechange ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a5_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified_nolatechange ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_nolatechange lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a5_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_nolatechange indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_nolatechange lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a5_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_nolatechange indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_nolatechange lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a5_paneld.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified_nolatechange indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


****************************************************
***Table A.6. Disaggregating Fractured Rebellions***
****************************************************
*Panel A. Number of rebel groups
use cmp_core.dta, clear
reg regime_fail fractured_low_groups fractured_high_groups peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a6_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(fractured_low_groups fractured_high_groups) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_groups fractured_high_groups lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a6_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths fractured_low_groups fractured_high_groups indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_groups fractured_high_groups ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a6_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(fractured_low_groups fractured_high_groups ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_groups fractured_high_groups lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a6_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths fractured_low_groups fractured_high_groups indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_groups fractured_high_groups lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a6_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths fractured_low_groups fractured_high_groups indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_groups fractured_high_groups lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a6_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths fractured_low_groups fractured_high_groups indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Fraction of troops for leading group
use cmp_core.dta, clear
reg regime_fail fractured_low_troops fractured_high_troops peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a6_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(fractured_low_troops fractured_high_troops) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_troops fractured_high_troops lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a6_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths fractured_low_troops fractured_high_troops indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_troops fractured_high_troops ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a6_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(fractured_low_troops fractured_high_troops ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_troops fractured_high_troops lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a6_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths fractured_low_troops fractured_high_troops indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_troops fractured_high_troops lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a6_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths fractured_low_troops fractured_high_troops indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail fractured_low_troops fractured_high_troops lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a6_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths fractured_low_troops fractured_high_troops indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


************************************************************
***Table A.7. Ordinal Count of the Number of Rebel Groups***
************************************************************
*Panel A. Count of rebel groups
use cmp_core.dta, clear
reg regime_fail num_rebels peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(num_rebels) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths num_rebels indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(num_rebels ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a7_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths num_rebels indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a7_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths num_rebels indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a7_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths num_rebels indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Count of rebel groups (log)
use cmp_core.dta, clear
reg regime_fail ln_num_rebels peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(ln_num_rebels) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths ln_num_rebels indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_num_rebels ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a7_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths ln_num_rebels indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a7_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths ln_num_rebels indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a7_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths ln_num_rebels indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel C. Count of rebel groups (capped at 5)
use cmp_core.dta, clear
reg regime_fail num_rebels_cap5 peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panelc.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(num_rebels_cap5) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths num_rebels_cap5 indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels_cap5 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(num_rebels_cap5 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a7_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths num_rebels_cap5 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a7_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths num_rebels_cap5 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a7_panelc.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths num_rebels_cap5 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel D. Count of rebel groups (capped at 5, log)
use cmp_core.dta, clear
reg regime_fail ln_num_rebels_cap5 peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_paneld.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(ln_num_rebels_cap5) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths ln_num_rebels_cap5 indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels_cap5 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a7_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_num_rebels_cap5 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a7_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths ln_num_rebels_cap5 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a7_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths ln_num_rebels_cap5 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail ln_num_rebels_cap5 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a7_paneld.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths ln_num_rebels_cap5 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


***********************************
***Table A.8. Alternative Models***
***********************************
*Panel A. Hazard model
use cmp_core.dta, clear
drop if year!=start_regime_year
gen fail=1
replace fail=0 if end_regime_year==2020
stset duration_years, failure(fail==1)
stcox unified if democracy==0, cluster(casenum)
outreg2 using table_a8_panela.tex, replace label nocon keep(unified) alpha(0.001, 0.01, 0.05) eform
stcox unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support if democracy==0, cluster(casenum)
outreg2 using table_a8_panela.tex, append label nocon ///
keep(unified ln_warlength ln_deaths indep_war sec_war foreign_support leftist lw) ///
alpha(0.001, 0.01, 0.05) eform
stcox unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region if democracy==0, cluster(casenum)
outreg2 using table_a8_panela.tex, append label nocon ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05) eform
stcox unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a8_panela.tex, append label nocon ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
alpha(0.001, 0.01, 0.05) eform
stcox unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a8_panela.tex, append label nocon ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
alpha(0.001, 0.01, 0.05) eform
stcox unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a8_panela.tex, append label nocon tex(frag) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
alpha(0.001, 0.01, 0.05) eform
*Panel B. Logit
use cmp_core.dta, clear
logit regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a8_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
logit regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a8_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
logit regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a8_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
logit regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a8_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
logit regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a8_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
logit regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a8_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel C. Cross Section
use cmp_core.dta, clear
drop if year!=start_regime_year
reg duration_years unified peaceyears _spline1 _spline2 _spline3 if democracy==0, r
outreg2 using table_a8_panelc.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg duration_years unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, r
outreg2 using table_a8_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg duration_years unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, r
outreg2 using table_a8_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg duration_years unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, r
outreg2 using table_a8_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg duration_years unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, r
outreg2 using table_a8_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg duration_years unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, r
outreg2 using table_a8_panelc.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


**********************************************************
***Table A.9. Exclude Borderline Cases of Rebel Regimes***
**********************************************************
*Panel A. Exclude cases with marginal death toll
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_deaths==0, cluster(casenum)
outreg2 using table_a9_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_deaths==0, cluster(casenum)
outreg2 using table_a9_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_deaths==0, cluster(casenum)
outreg2 using table_a9_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_deaths==0, cluster(casenum)
outreg2 using table_a9_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_deaths==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a9_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if borderline_deaths==0, cluster(casenum)
outreg2 using table_a9_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Exclude cases with substantial involvement of foreign actors
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_foreign==0, cluster(casenum)
outreg2 using table_a9_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_foreign==0, cluster(casenum)
outreg2 using table_a9_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_foreign==0, cluster(casenum)
outreg2 using table_a9_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_foreign==0, cluster(casenum)
outreg2 using table_a9_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_foreign==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a9_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if borderline_foreign==0, cluster(casenum)
outreg2 using table_a9_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel C. Exclude cases with substantial participation by government insiders
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_outsider==0, cluster(casenum)
outreg2 using table_a9_panelc.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_outsider==0, cluster(casenum)
outreg2 using table_a9_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_outsider==0, cluster(casenum)
outreg2 using table_a9_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_outsider==0, cluster(casenum)
outreg2 using table_a9_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_outsider==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a9_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if borderline_outsider==0, cluster(casenum)
outreg2 using table_a9_panelc.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel D. Exclude cases with ambiguous rebel success
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_succreb==0, cluster(casenum)
outreg2 using table_a9_paneld.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_succreb==0, cluster(casenum)
outreg2 using table_a9_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_succreb==0, cluster(casenum)
outreg2 using table_a9_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_succreb==0, cluster(casenum)
outreg2 using table_a9_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_succreb==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a9_paneld.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if borderline_succreb==0, cluster(casenum)
outreg2 using table_a9_paneld.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel E. Exclude all borderline cases
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_any==0, cluster(casenum)
outreg2 using table_a9_panele.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_any==0, cluster(casenum)
outreg2 using table_a9_panele.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & borderline_any==0, cluster(casenum)
outreg2 using table_a9_panele.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_any==0, cluster(casenum)
outreg2 using table_a9_panele.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & borderline_any==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a9_panele.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if borderline_any==0, cluster(casenum)
outreg2 using table_a9_panele.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


*********************************************************
***Table A.10. Exclude Regimes in China or Afghanistan***
*********************************************************
*Panel A. Drop China
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & country!="China", cluster(casenum)
outreg2 using table_a10_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & country!="China", cluster(casenum)
outreg2 using table_a10_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & country!="China", cluster(casenum)
outreg2 using table_a10_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & country!="China", cluster(casenum)
outreg2 using table_a10_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & country!="China" & limited_recog==0, cluster(casenum)
outreg2 using table_a10_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if country!="China", cluster(casenum)
outreg2 using table_a10_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Drop Afghanistan
use cmp_core.dta, clear
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0 & country!="Afghanistan", cluster(casenum)
outreg2 using Table_a10_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & country!="Afghanistan", cluster(casenum)
outreg2 using Table_a10_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & country!="Afghanistan", cluster(casenum)
outreg2 using Table_a10_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & country!="Afghanistan", cluster(casenum)
outreg2 using Table_a10_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & country!="Afghanistan" & limited_recog==0, cluster(casenum)
outreg2 using Table_a10_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if country!="Afghanistan", cluster(casenum)
outreg2 using Table_a10_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


********************************************************************************
***Table A.11. Comparing Unified/Fractured Rebel Autocracies within Countries***
********************************************************************************
use cmp_core.dta, clear
outsheet casename unified duration_years using table_a11.txt if countryfe_sample==1 & year==start_regime_year, comma replace


********************************************
***Table A.12. Controlling for Country FE***
********************************************
use cmp_core.dta, clear
reg regime_fail unified i.ccode if democracy==0 & countryfe_sample==1, cluster(casenum)
outreg2 using table_a12.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 i.ccode if democracy==0 & countryfe_sample==1, cluster(casenum)
outreg2 using table_a12.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)


*******************************************
***Table A.13. Episodes of State Failure***
*******************************************
*Generated by authors using sources described in the article


****************************************
***Table A.14. Recoding State Failure***
****************************************
*Panel A. More stringent
use cmp_core.dta, clear
gen statefailure_alt1=0
replace statefailure_alt1=1 if casename=="Angola 1975-92"
replace statefailure_alt1=1 if casename=="Cyprus 1960-63"
replace statefailure_alt1=1 if casename=="Congo/Zaire 1997-98"
replace statefailure_alt1=1 if casename=="South Sudan 2011-13"
drop if statefailure_alt1==1
drop statefailure_alt1
merge 1:1 casenum year using cmp_statefailure_alt1.dta
drop _merge
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a14_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a14_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a14_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a14_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a14_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a14_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. More permissive
use cmp_core.dta, clear
gen statefailure_alt2=0
replace statefailure_alt2=1 if casename=="Mexico 1914-20"
replace statefailure_alt2=1 if casename=="Mexico 1911-13"
replace statefailure_alt2=1 if casename=="Chad 1979-82"
replace statefailure_alt2=1 if casename=="Uganda 1979-86"
replace statefailure_alt2=1 if casename=="Iran 1908-09"
replace statefailure_alt2=1 if casename=="Yemen 2015-NA"
replace statefailure_alt2=1 if casename=="Afghanistan 1992-96"
replace statefailure_alt2=1 if casename=="China 1924-28"
drop if statefailure_alt2==1
drop statefailure_alt2
merge 1:1 casenum year using cmp_statefailure_alt2.dta
drop _merge
reg regime_fail unified peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a14_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a14_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a14_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a14_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a14_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a14_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


************************************************************
***Table A.15. Correlates of Unified/Fractured Rebellions***
************************************************************
use cmp_core.dta, clear
drop if year!=start_regime_year
reg unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support, r
outreg2 using table_a15.tex, replace label nocon alpha(0.001, 0.01, 0.05) keep(lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support)
reg unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region, r
outreg2 using table_a15.tex, append label nocon alpha(0.001, 0.01, 0.05) keep(ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest)
reg unified lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, r
outreg2 using table_a15.tex, append label nocon alpha(0.001, 0.01, 0.05) keep(lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest)
use allwars_covar.dta, clear
reg unified ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region sec_war, r
use cmp_core.dta, clear
outreg2 using table_a15.tex, append label nocon tex(frag) alpha(0.001, 0.01, 0.05)  keep(ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest)


***********************************************************
***Table A.16. Social Revolutions and Leftist Rebellions***
***********************************************************
use cmp_core.dta, clear
*Panel A. Social revolutions
reg regime_fail lw peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panela.tex, replace label nocon addtext(Duration/splines, YES) keep(lw) alpha(0.001, 0.01, 0.05)
reg regime_fail lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar i.region peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panela.tex, append label nocon addtext(Duration/splines, YES) keep(lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail lw fragmented_notlw peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panela.tex, append label nocon addtext(Duration/splines, YES) keep(lw fragmented_notlw) alpha(0.001, 0.01, 0.05)
reg regime_fail lw fragmented_notlw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar i.region peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panela.tex, append label nocon addtext(Duration/splines, YES) keep(lw fragmented_notlw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar) alpha(0.001, 0.01, 0.05) tex(frag)
*Panel B. Leftist rebellions
reg regime_fail leftist peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panelb.tex, replace label nocon addtext(Duration/splines, YES) keep(leftist) alpha(0.001, 0.01, 0.05)
reg regime_fail leftist ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar i.region peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panelb.tex, append label nocon addtext(Duration/splines, YES) keep(leftist ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail leftist fragmented_notleft peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panelb.tex, append label nocon addtext(Duration/splines, YES) keep(leftist fragmented_notleft) alpha(0.001, 0.01, 0.05)
reg regime_fail leftist fragmented_notleft ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar i.region peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a16_panelb.tex, append label nocon addtext(Duration/splines, YES) keep(leftist fragmented_notleft ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic i.period_coldwar) alpha(0.001, 0.01, 0.05) tex(frag)
*Cross tabs
summarize regime_fail if lw==1 & democracy==0
summarize regime_fail if democracy==0 & unified_notlw==1
summarize regime_fail if democracy==0 & fragmented_notlw==1
summarize regime_fail if leftist==1 & democracy==0
summarize regime_fail if democracy==0 & unified_notleft==1
summarize regime_fail if democracy==0 & fragmented_notleft==1


*******************************************************
***Table A.17. Alternative Aspects of Rebel Ideology***
*******************************************************
use cmp_core.dta, clear
reg regime_fail unified islamist rightwing democratic nationalist urban multiple_ideology peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a17.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified islamist rightwing democratic nationalist urban multiple_ideology) alpha(0.001, 0.01, 0.05)
reg regime_fail unified islamist rightwing democratic nationalist urban multiple_ideology lw  indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a17.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified islamist rightwing democratic nationalist urban multiple_ideology indep_war sec_war foreign_support  lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified islamist rightwing democratic nationalist urban multiple_ideology ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a17.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified islamist rightwing democratic nationalist urban multiple_ideology ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified islamist rightwing democratic nationalist urban multiple_ideology lw  indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a17.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified islamist rightwing democratic nationalist urban multiple_ideology indep_war sec_war foreign_support  lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified islamist rightwing democratic nationalist urban multiple_ideology lw  indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a17.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified islamist rightwing democratic nationalist urban multiple_ideology indep_war sec_war foreign_support  lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified islamist rightwing democratic nationalist urban multiple_ideology lw  indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a17.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified islamist rightwing democratic nationalist urban multiple_ideology indep_war sec_war foreign_support  lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


***************************************************
***Table A.18. Alternative Measures of Ethnicity***
***************************************************
*Panel A. Ethnic war aims
use cmp_core.dta, clear
reg regime_fail unified ethnic peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified ethnic) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified ethnic indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ethnic ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ethnic ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a18_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified ethnic indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a18_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified ethnic indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a18_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified ethnic indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Multiethnic rebellions
use cmp_core.dta, clear
reg regime_fail unified multiethnic peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified multiethnic) alpha(0.001, 0.01, 0.05)
reg regime_fail unified multiethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified multiethnic indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified multiethnic ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified multiethnic ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified multiethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a18_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified multiethnic indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified multiethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a18_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified multiethnic indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified multiethnic lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a18_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified multiethnic indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel C. Countries with multiple large ethnic groups
use cmp_core.dta, clear
reg regime_fail unified large_ethnic_30 peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panelc.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified large_ethnic_30) alpha(0.001, 0.01, 0.05)
reg regime_fail unified large_ethnic_30 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified large_ethnic_30 indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified large_ethnic_30 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a18_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified large_ethnic_30 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified large_ethnic_30 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a18_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified large_ethnic_30 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified large_ethnic_30 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a18_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified large_ethnic_30 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified large_ethnic_30 lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a18_panelc.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified large_ethnic_30 indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


**********************************************************
***Table A.19. Alternative Measures of Social Cleavages***
**********************************************************
use cmp_core.dta, clear
reg regime_fail unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a19.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps) alpha(0.001, 0.01, 0.05)
reg regime_fail unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a19.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a19.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a19.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a19.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a19.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified frac_ethnic frac_language frac_religion ln_area ln_muslim v2cacamps indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


********************************************************
***Table A.20. Alternative Measures of State Capacity***
********************************************************
use cmp_core.dta, clear
reg regime_fail unified Capacity lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a20.tex, replace label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(Capacity ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified v2svstterr lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a20.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(v2svstterr ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified v2stfisccap lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a20.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(v2stfisccap ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified milper_pop lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a20.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(milper_pop ln_warlength ln_deaths unified indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


********************************************************
***Table A.21. Alternative Measures of Rebel Capacity***
********************************************************
*Panel A. Rebel public goods
use cmp_core.dta, clear
reg regime_fail unified pg peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a21_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified pg) alpha(0.001, 0.01, 0.05)
reg regime_fail unified pg lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a21_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified pg indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified pg ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a21_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified pg ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified pg lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a21_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified pg indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified pg lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a21_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified pg indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified pg lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a21_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified pg indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Age of oldest rebel group
use cmp_core.dta, clear
reg regime_fail unified ln_oldest_age peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a21_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified ln_oldest_age) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_oldest_age lw leftist indep_war sec_war ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a21_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_deaths unified ln_oldest_age indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_oldest_age ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a21_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified ln_oldest_age ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_oldest_age lw leftist indep_war sec_war ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a21_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_deaths unified ln_oldest_age indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_oldest_age lw leftist indep_war sec_war ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a21_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_deaths unified ln_oldest_age indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified ln_oldest_age lw leftist indep_war sec_war ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a21_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_deaths unified ln_oldest_age indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)


*****************************************************
***Table A.22. Correlates of Successful Rebellions***
*****************************************************
use allwars_covar.dta, clear
reg success unified sec_war ln_pop ln_gdppc ln_oilgas urban_pop ethnic_frac civilreg lmtnest i.period_coldwar i.region, r
outreg2 using table_a22.tex, replace label nocon ctitle(Successful rebellion) alpha(0.001, 0.01, 0.05)
reg success unified ln_pop ln_gdppc ln_oilgas urban_pop ethnic_frac civilreg lmtnest i.period_coldwar i.region if sec_war==0, r
outreg2 using table_a22.tex, append label nocon ctitle(Successful rebellion) alpha(0.001, 0.01, 0.05)
reg success ln_pop sec_war ln_gdppc ln_oilgas urban_pop ethnic_frac civilreg lmtnest i.period_coldwar i.region if unified==1, r
outreg2 using table_a22.tex, append label nocon ctitle(Successful rebellion) alpha(0.001, 0.01, 0.05)
reg success ln_pop ln_gdppc ln_oilgas urban_pop ethnic_frac civilreg lmtnest i.period_coldwar i.region if unified==1 & sec_war==0, r
outreg2 using table_a22.tex, append label nocon ctitle(Successful rebellion) alpha(0.001, 0.01, 0.05)
reg success ln_pop sec_war ln_gdppc ln_oilgas urban_pop ethnic_frac civilreg lmtnest i.period_coldwar i.region if unified==0, r
outreg2 using table_a22.tex, append label nocon ctitle(Successful rebellion) alpha(0.001, 0.01, 0.05)
reg success ln_pop ln_gdppc ln_oilgas urban_pop ethnic_frac civilreg lmtnest i.period_coldwar i.region if unified==0 & sec_war==0, r
outreg2 using table_a22.tex, append label nocon ctitle(Successful rebellion) alpha(0.001, 0.01, 0.05) tex(frag)


***************************************************************************
***Table A.23. Power-Sharing Trajectories following Fractured Rebellions***
***************************************************************************
use cmp_mechanisms.dta, clear
sort country start_regime_year
outsheet casename using table_a23_conflict.txt if unified==0 & sharing=="conflict", comma replace
outsheet casename using table_a23_consolidation.txt if unified==0 & sharing=="consolidation", comma replace
outsheet casename using table_a23_success.txt if unified==0 & sharing=="successful", comma replace
outsheet casename using table_a23_none.txt if unified==0 & sharing=="none", comma replace


*************************************************************************
***Table A.24. Power-Sharing Trajectories following Unified Rebellions***
*************************************************************************
use cmp_mechanisms.dta, clear
sort country start_regime_year
outsheet casename using table_a24_conflict.txt if unified==1 & sharing=="conflict", comma replace
outsheet casename using table_a24_consolidation.txt if unified==1 & sharing=="consolidation", comma replace
outsheet casename using table_a24_success.txt if unified==1 & sharing=="successful", comma replace
outsheet casename using table_a24_none.txt if unified==1 & sharing=="none", comma replace


***********************************************
*** Table A.25: How Authoritarian Regimes Fall
***********************************************
use cmp_allauth.dta, clear

*-----------------------------------------------
* Define groups and their labels
*-----------------------------------------------
local cond1 "rebel_cmp == 1"
local cond2 "rebel_cmp == 1 & unified == 1"
local cond3 "rebel_cmp == 1 & unified == 0"
local cond4 "rebel_cmp == 0"

local label1 "Rebel regimes"
local label2 "Unified rebellion"
local label3 "Fractured rebellion"
local label4 "Non-rebel autocracies"

*-----------------------------------------------
* Create matrix to hold results
*-----------------------------------------------
matrix results = J(4,5,.)
local nrows = 4

*-----------------------------------------------
* Loop over each condition
*-----------------------------------------------
forvalues i = 1/`nrows' {
    local cond  "`cond`i''"
    local label "`label`i''"

    quietly summarize regime_end_reb if `cond'
    local reb = r(mean)
    quietly summarize regime_end_coup if `cond'
    local coup = r(mean)
    quietly summarize regime_end_other if `cond'
    local other = r(mean)
    quietly summarize regime_end_not if `cond'
    local not = r(mean)
    quietly count if `cond'
    local n = r(N)

    matrix results[`i',1] = 100*`reb'
    matrix results[`i',2] = 100*`coup'
    matrix results[`i',3] = 100*`other'
    matrix results[`i',4] = 100*`not'
    matrix results[`i',5] = `n'
}

*-----------------------------------------------
* Write LaTeX table
*-----------------------------------------------
capture file close tex
file open tex using "table_a25.tex", write replace

file write tex "\begin{table}[htb!]" _n
file write tex "\begin{center}" _n
file write tex "\caption{How Authoritarian Regimes Fall}" _n
file write tex "\label{how_end}" _n
file write tex "\singlespacing" _n
file write tex "\small" _n
file write tex "\vspace{-1.5em}" _n
file write tex "\begin{tabular}{lccccc} \hline" _n
file write tex "\textbf{Sample} & \textbf{Rebellion/state failure} & \textbf{Coup} & \textbf{Other} & \textbf{Still in power} & \textbf{N} \\ \hline" _n

forvalues i = 1/`nrows' {
    local lbl = "`label`i''"
    local reb  : display %4.0f results[`i',1]
    local coup : display %4.0f results[`i',2]
    local other: display %4.0f results[`i',3]
    local not  : display %4.0f results[`i',4]
    local n    : display %4.0f results[`i',5]

    if inlist(`i',2,3) {
        local prefix "\hspace{1em}"
    }
    else {
        local prefix ""
    }

    file write tex "`prefix'`lbl' & `reb'\% & `coup'\% & `other'\% & `not'\% & `n' \\ " _n
}

file write tex " \hline" _n
file write tex "\end{tabular}" _n
file write tex "\end{center}" _n
file write tex "\medskip" _n
file write tex "\justify\footnotesize{\textit{Notes}:}" _n
file write tex "\end{table}" _n
file close tex


************************************************************
***Table A.26. Regime Failure (All Authoritarian Regimes)***
************************************************************
use cmp_allauth_tscs.dta, clear
reg regime_fail unified_reb fractured_reb peaceyears _spline1 _spline2 _spline3, cluster(casenum2)
outreg2 using table_a26.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(unified_reb fractured_reb) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05) tex(frag)
reg regime_fail unified_reb fractured_reb ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest civilreg i.period_coldwar i.region peaceyears _spline1 _spline2 _spline3, cluster(casenum2)
outreg2 using table_a26.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified_reb fractured_reb ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest civilreg i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified_reb_notlw fractured_reb_notlw lw peaceyears _spline1 _spline2 _spline3, cluster(casenum2)
outreg2 using table_a26.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(unified_reb_notlw fractured_reb_notlw lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05) tex(frag)
reg regime_fail unified_reb_notlw fractured_reb_notlw lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest civilreg i.period_coldwar i.region peaceyears _spline1 _spline2 _spline3, cluster(casenum2)
outreg2 using table_a26.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified_reb_notlw fractured_reb_notlw lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic lmtnest civilreg i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05) tex(frag)
*Summary stats
summarize regime_fail if unified_reb==1
summarize regime_fail if fractured_reb==1
summarize regime_fail if unified_reb+fractured_reb==0


********************************************
***Table A.27. Post-Founding Institutions***
********************************************
*Panel A. Controlling for GWF Single-Party Regimes
use cmp_core.dta, clear
reg regime_fail unified party peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a27_panela.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified party ) alpha(0.001, 0.01, 0.05)
reg regime_fail unified party  lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a27_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified party  indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified party  ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a27_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified party  ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified party  lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a27_panela.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified party  indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified party lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a27_panela.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified party democracy indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel B. Controlling for GWF Single-Party/Military/Personalist Regimes
use cmp_core.dta, clear
reg regime_fail unified personal military monarchy peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a27_panelb.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified personal military monarchy) alpha(0.001, 0.01, 0.05)
reg regime_fail unified personal military monarchy lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a27_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified personal military monarchy indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified personal military monarchy ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0, cluster(casenum)
outreg2 using table_a27_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified personal military monarchy ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified personal military monarchy lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0, cluster(casenum)
outreg2 using table_a27_panelb.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified personal military monarchy indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified personal military monarchy democracy lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar, cluster(casenum)
outreg2 using table_a27_panelb.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified personal military monarchy democracy indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
*Panel C. Controlling for V-Dem Polyarchy
use cmp_core.dta, clear
reg regime_fail unified v2x_polyarchy  peaceyears _spline1 _spline2 _spline3 if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a27_panelc.tex, replace label nocon addtext(Duration/splines, YES, Region FE, NO) keep(unified v2x_polyarchy ) alpha(0.001, 0.01, 0.05)
reg regime_fail unified v2x_polyarchy  lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a27_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, NO) ///
keep(ln_warlength ln_deaths unified v2x_polyarchy  indep_war sec_war foreign_support leftist lw) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified v2x_polyarchy  ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar i.region ///
peaceyears _spline1 _spline2 _spline3 if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a27_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(unified v2x_polyarchy  ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) alpha(0.001, 0.01, 0.05)
reg regime_fail unified v2x_polyarchy  lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if democracy==0 & limited_recog==0, cluster(casenum)
outreg2 using table_a27_panelc.tex, append label nocon addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified v2x_polyarchy  indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
reg regime_fail unified v2x_polyarchy lw leftist indep_war sec_war ln_warlength ln_deaths foreign_support ///
peaceyears _spline1 _spline2 _spline3 ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.region i.period_coldwar if limited_recog==0, cluster(casenum)
outreg2 using table_a27_panelc.tex, append label nocon tex(frag) addtext(Duration/splines, YES, Region FE, YES) ///
keep(ln_warlength ln_deaths unified v2x_polyarchy democracy indep_war sec_war foreign_support leftist lw ln_pop ln_gdppc ln_oilgas urban_pop frac_ethnic civilreg lmtnest i.period_coldwar) ///
ctitle(Regime failure) alpha(0.001, 0.01, 0.05)
